import { useEffect } from 'react';
import { useStore } from 'react-redux';

import { hide, show } from '../redux/features/tabbarSlice';

const useAutoHandleTabbar = () => {
  const { dispatch } = useStore();
  useEffect(() => {
    dispatch(hide());
    return () => {
      dispatch(show());
    };
  }, [dispatch]);
};

export { useAutoHandleTabbar };
